/**
 */
package org.mro.grib.model.files.firstEdition.grids.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.mro.grib.model.files.firstEdition.FirstEditionPackage;
import org.mro.grib.model.files.firstEdition.grids.GridsFactory;
import org.mro.grib.model.files.firstEdition.grids.GridsPackage;
import org.mro.grib.model.files.firstEdition.grids.IGridDefinition;
import org.mro.grib.model.files.firstEdition.impl.FirstEditionPackageImpl;
import org.mro.grib.model.files.firstEdition.sections.SectionsPackage;
import org.mro.grib.model.files.firstEdition.sections.impl.SectionsPackageImpl;
import org.mro.grib.model.files.secondEdition.SecondEditionPackage;
import org.mro.grib.model.files.secondEdition.dataRepresentations.DataRepresentationsPackage;
import org.mro.grib.model.files.secondEdition.dataRepresentations.impl.DataRepresentationsPackageImpl;
import org.mro.grib.model.files.secondEdition.impl.SecondEditionPackageImpl;
import org.mro.grib.model.files.secondEdition.products.ProductsPackage;
import org.mro.grib.model.files.secondEdition.products.impl.ProductsPackageImpl;
import org.mro.grib.model.files.secondEdition.products.meteorological.MeteorologicalPackage;
import org.mro.grib.model.files.secondEdition.products.meteorological.impl.MeteorologicalPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class GridsPackageImpl extends EPackageImpl implements GridsPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass iGridDefinitionEClass = null;
	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see org.mro.grib.model.files.firstEdition.grids.GridsPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private GridsPackageImpl() {
		super(eNS_URI, GridsFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link GridsPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static GridsPackage init() {
		if (isInited) return (GridsPackage)EPackage.Registry.INSTANCE.getEPackage(GridsPackage.eNS_URI);

		// Obtain or create and register package
		GridsPackageImpl theGridsPackage = (GridsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof GridsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new GridsPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		FirstEditionPackageImpl theFirstEditionPackage = (FirstEditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(FirstEditionPackage.eNS_URI) instanceof FirstEditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(FirstEditionPackage.eNS_URI) : FirstEditionPackage.eINSTANCE);
		SectionsPackageImpl theSectionsPackage = (SectionsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SectionsPackage.eNS_URI) instanceof SectionsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SectionsPackage.eNS_URI) : SectionsPackage.eINSTANCE);
		SecondEditionPackageImpl theSecondEditionPackage = (SecondEditionPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(SecondEditionPackage.eNS_URI) instanceof SecondEditionPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(SecondEditionPackage.eNS_URI) : SecondEditionPackage.eINSTANCE);
		org.mro.grib.model.files.secondEdition.grids.impl.GridsPackageImpl theGridsPackage_1 = (org.mro.grib.model.files.secondEdition.grids.impl.GridsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.grids.GridsPackage.eNS_URI) instanceof org.mro.grib.model.files.secondEdition.grids.impl.GridsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.grids.GridsPackage.eNS_URI) : org.mro.grib.model.files.secondEdition.grids.GridsPackage.eINSTANCE);
		org.mro.grib.model.files.secondEdition.sections.impl.SectionsPackageImpl theSectionsPackage_1 = (org.mro.grib.model.files.secondEdition.sections.impl.SectionsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.sections.SectionsPackage.eNS_URI) instanceof org.mro.grib.model.files.secondEdition.sections.impl.SectionsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(org.mro.grib.model.files.secondEdition.sections.SectionsPackage.eNS_URI) : org.mro.grib.model.files.secondEdition.sections.SectionsPackage.eINSTANCE);
		ProductsPackageImpl theProductsPackage = (ProductsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(ProductsPackage.eNS_URI) instanceof ProductsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(ProductsPackage.eNS_URI) : ProductsPackage.eINSTANCE);
		MeteorologicalPackageImpl theMeteorologicalPackage = (MeteorologicalPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(MeteorologicalPackage.eNS_URI) instanceof MeteorologicalPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(MeteorologicalPackage.eNS_URI) : MeteorologicalPackage.eINSTANCE);
		DataRepresentationsPackageImpl theDataRepresentationsPackage = (DataRepresentationsPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(DataRepresentationsPackage.eNS_URI) instanceof DataRepresentationsPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(DataRepresentationsPackage.eNS_URI) : DataRepresentationsPackage.eINSTANCE);

		// Create package meta-data objects
		theGridsPackage.createPackageContents();
		theFirstEditionPackage.createPackageContents();
		theSectionsPackage.createPackageContents();
		theSecondEditionPackage.createPackageContents();
		theGridsPackage_1.createPackageContents();
		theSectionsPackage_1.createPackageContents();
		theProductsPackage.createPackageContents();
		theMeteorologicalPackage.createPackageContents();
		theDataRepresentationsPackage.createPackageContents();

		// Initialize created meta-data
		theGridsPackage.initializePackageContents();
		theFirstEditionPackage.initializePackageContents();
		theSectionsPackage.initializePackageContents();
		theSecondEditionPackage.initializePackageContents();
		theGridsPackage_1.initializePackageContents();
		theSectionsPackage_1.initializePackageContents();
		theProductsPackage.initializePackageContents();
		theMeteorologicalPackage.initializePackageContents();
		theDataRepresentationsPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theGridsPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(GridsPackage.eNS_URI, theGridsPackage);
		return theGridsPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getIGridDefinition() {
		return iGridDefinitionEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public GridsFactory getGridsFactory() {
		return (GridsFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		iGridDefinitionEClass = createEClass(IGRID_DEFINITION);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(iGridDefinitionEClass, IGridDefinition.class, "IGridDefinition", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$
	}

} //GridsPackageImpl
